package com.heima.article.job;
import com.heima.article.service.HotArticleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
@Log4j2
public class ComputeHotArticleJob {
    @Autowired
    private HotArticleService hotArticleService;
    @XxlJob("computeHotArticleJob")
    public ReturnT computeHotArticleJob (String params) {
        log.info("计算热点文章的定时任务被触发======================================");
        hotArticleService.computeHotArticle();
        log.info("计算热点文章的定时任务执行完毕======================================");
        return ReturnT.SUCCESS;
    }
}